<?php session_start();?>
<!DOCTYPE html>
<html>
<head>
<style type="text/css">
.profile {
	text-align: center;
}

.image:hover {
	border: thin solid #000;
}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Profile</title>
</head>
<body>
	<?php
	$uid=$_SESSION["UID"];
	$con=mysql_connect("localhost","root","");
	if(!$con)
	{
		die('Could not connect to server');
	}

	mysql_select_db("se_group2",$con);
	$result = mysql_query("SELECT *
			FROM  `student` , `user`
			WHERE `student`.`UID` =".$uid."
			AND `user`.`UID` =".$uid);
	$row = mysql_fetch_array($result);
	$name = $row['name'];
	$edit = "www.google.com";
	$image = $row['img_id'];
	$mail = $row['email_id'];
	$roll = $row['roll_no'];
	$website = $row['website'];
	$batch = $row['batch'];
	if($image=="")
	{
		$image = "profile.jpg";
	}
	echo '<div class="profile">
					<b style="text-align: middle;">'.$name.'</b> [<a
			href="'.$edit.'">edit</a>]<br> <br> <img class="image"
			border="0" src="../images/profile/'.$image.'" alt="Oops... there was some error loading image" width="150" height="150"
			align="center" draggable="true"> <br> <br>
			<div style="text-align: left;">
			<b>Batch: </b>'.$batch.'<br> <br> <b>Roll No.: </b> '.$roll.'<br> <br>
					<b>Email: </b><a href="'.$mail.'"
					target="_parent">'.$mail.'</a><br>';
	if(strlen($website)>0)
	{
		echo ' <br> <b>Website: </b><a href="http://'.$website.'" target="_blank">'.$website.'</a>';
	}
	echo 
					'</div>
					</div>';
	?>
</body>
</html>
